﻿<%@ Page Language="C#"  MasterPageFile="~/MasterPage.master" AutoEventWireup="true" Inherits="Nivdal.UserPage" Title=" " StylesheetTheme="SkinFile" Codebehind="UserPage.aspx.cs" %>
  
<asp:Content ID="PageNameContent" ContentPlaceHolderID="PageNamePlaceHolder" runat="server">
    <asp:Label ID="PageNameLabel" runat="server" Text="<%$ Resources:Resource, UserPage_PageNameLabel%>" CssClass="PageNameContentStyle"></asp:Label>
</asp:Content>
<asp:Content ContentPlaceHolderID="HeadPlaceHolder" ID="Head" runat="server" >
    <script language="javascript" type="text/javascript">

       
        function HideFriendsDiv() {
            $("#friendsDiv").hide(200);
            return true;
        }
        function MutualFriendsHide() {
            $("#MutualFriendsDiv").hide(200);
        }
    </script>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:HiddenField ID="UserIdHiddenField" runat="server" />
    <asp:HiddenField ID="LanguageHiddenField" runat="server" />
    <asp:Label ID="ErrorLabel" runat="server" Text=""></asp:Label>
                <div class="basic_element">
                <div class="tbl"><div class="tblr"><div class="tblc">
                <div class="red_title_no_padding">
                <div class="grey_title_inside_red floater" >
                    
                    <asp:Hyperlink ID="NationalCoachImage" runat="server"></asp:Hyperlink>
                    <asp:Label ID="UserNameLabel" runat="server" Text="" SkinID="TeamNameLabel" CssClass="team_name_white" />
                </div>
                    <div class="grey_title_triangle floater"></div>
                    <asp:Image ID="UserIconImage" runat="server" />
                    <asp:Image ID="IsFriendImage" runat="server" ToolTip="<%$ Resources:Resource, TeamHomePage_IsFriendImageToolTip %>"
                        ImageUrl="~/Images/Icons/friends.png"/>
                    <asp:ImageButton ID="SuggestFriendshipImage" runat="server" ToolTip="<%$ Resources:Resource, TeamHomePage_BecomeFriendsToolTip %>"
                        ImageUrl="~/Images/Icons/friends_Suggest.png" OnClick="BecomeFriendButtonClick"/>
                    <asp:HyperLink ID="FriendshipSuggestionPendingImage" runat="server" ImageUrl="~/Images/Icons/friendship_pending.png"
                        ToolTip="<%$ Resources:Resource, TeamHomePage_FriendshipSuggestionPendingImageToolTip %>"
                        NavigateUrl="~/Friends.aspx" ></asp:HyperLink>  
                    <asp:Image ID="IsPremiumImage" runat="server" ImageUrl="~/Images/Icons/premium.png" ToolTip="<%$ Resources:Resource, Global_PremiumUser %>" />
                    <asp:ImageButton ID="FlagButton" runat="server" />
                    <asp:ImageButton ID="BookmarkButton" runat="server" Visible="false" OnClick="BookmarkButton_Click" AlternateText="<%$ Resources:Resource, UserPage_BookmarkButtonToolTip %>"
                    ImageUrl="~/Images/bookmarked.png" ToolTip="<%$ Resources:Resource, UserPage_BookmarkButtonToolTip %>" /> 
                    <asp:ImageButton ID="ComposeMessageImageButton" ToolTip="<%$ Resources:Resource, ComposeMessageImageButton_ToolTip %>"
                        ImageUrl="~/Images/Icons/mail.png"  runat="server" OnClick="SendMailLinkButtonButton_Click"></asp:ImageButton>       
                    <asp:Image ID="IsOnlineImage" runat="server" ImageUrl="~/Images/Icons/IsOnline.png" ToolTip="<%$ Resources:Resource, Global_Online %>" />
                    <asp:Image ID="IsOfflineImage" runat="server" ImageUrl="~/Images/Icons/offline.png" ToolTip="<%$ Resources:Resource, Global_Offline %>" />
                    <asp:ImageButton ID="LockUserImageButton" runat="server" ImageUrl="~/Images/Icons/ThreadClosed.png"
                        message="<%$ Resources:Resource, UserPage_LockUserToolTip %>"
                        OnClick="LockUser" OnClientClick='return confirm(this.getAttribute("message"))' ToolTip="<%$ Resources:Resource, UserPage_LockUserToolTip %>" />
                    <asp:HyperLink ID="ReportHyperlink" runat="server" ImageUrl="~/Images/Icons/report.png" 
                    ToolTip="View connections report"></asp:HyperLink>
                    <asp:Image ID="ForumRankImage" runat="server" /> 
                </div>
                </div></div></div>
                <div class="padding5">
                    <table style="width:100%; ">
                    <tr>
                    <td style="width:50%;vertical-align:top;">
                    <table style="width:100%;">
                    <tr>                    
                    <td style="width:50%; vertical-align:top;">
                        
                        <asp:ImageButton ID="UserPicture" runat="server" ToolTip="<%$ Resources:Resource, UserPage_UserPictureToolTip %>"
                            onerror="this.src='Images/menupicture.gif';" ></asp:ImageButton>
                        <asp:Panel ID="LinkToUserInfoPanel" runat="server" Visible="false">
                            <asp:HyperLink ID="PreferencesHyperlink" runat="server" SkinID="GreenTitleHyperLink"
                                NavigateUrl="~/Preferences.aspx" Text="<%$ Resources:Resource, UserPage_PreferencesHyperlink %>"></asp:HyperLink>
                           
                    </asp:Panel> 
                    </td>
                    <td style="width:50%; vertical-align:top;">
                            
                        <asp:Label ID="UpdateUpdateLabel" runat="server" Text='<%# Resources.Resource.Global_TeamName+ ":"%>' SkinID="InfoLabel"></asp:Label>
                        <br />
                        <asp:Hyperlink ID="TeamLinkButton" runat="server" SkinID="GreenTitleHyperLink" ></asp:Hyperlink>
                        <br /> 
                        <asp:Label ID="PreferredLanguageTitleLabel" runat="server" SkinID="InfoLabel"></asp:Label>
                        <br />
                        <asp:Label ID="JoinedLabel" runat="server" SkinID="InfoLabel" ></asp:Label>
                        <br />
                        <asp:Label ID="LastLoginLabel" runat="server" SkinID="InfoLabel"></asp:Label>
                            
                    </td>
                    </tr>
                </table>
                <asp:Label ID="FriendsTitleLable" runat="server" SkinID="InfoLabel"
                Text="<%$ Resources:Resource, UserPage_FriendsTitleLableText  %>"></asp:Label>
                <br />
                
                
                <asp:UpdateProgress ID="FriendsUpdateProgress" runat="server" AssociatedUpdatePanelID="FriendsUpdatePanel">
                    <ProgressTemplate>
                        <div class="ajaxloader">
                            <asp:Image ID="MessagesUpdatePanelProgressImage" runat="server" ImageUrl="~/Images/ajax-loader.gif" />
                        </div> 
                    </ProgressTemplate>
                </asp:UpdateProgress>                    
                
                <asp:UpdatePanel ID="FriendsUpdatePanel" runat="server" UpdateMode="Conditional">
                <ContentTemplate>
                    <div id="friendsDiv"> 
                    <asp:ListView ID="FriendsListView" runat="server" DataSourceID="FriendsListDataSource" OnDataBound="FriendsListViewDataBound" >
                        <LayoutTemplate>
                            <asp:Label ID="itemplaceholder" runat="server"></asp:Label>
                        </LayoutTemplate>
                        <ItemTemplate>
                            <asp:HyperLink ID="UserNameHyperlink" runat="server" SkinID="GreenTitleHyperLink"
                             Text='<%# Eval("UserName") %>' NavigateUrl='<%# "~/UserPage.aspx?Id=" + Eval("UserId") %>'></asp:HyperLink>                        
                        </ItemTemplate>
                        <ItemSeparatorTemplate>
                            <asp:Label ID="CommaLabel" runat="server" Text=", "></asp:Label>
                        </ItemSeparatorTemplate>
                        <EmptyDataTemplate>
                            <asp:Label ID="NoFriendsLabel" runat="server" SkinID="GridLabel"
                            Text="<%$ Resources:Resource, UserPage_NoFriendsLabelText  %>"></asp:Label>
                        </EmptyDataTemplate>
                    </asp:ListView>
                    </div>
                    <br />
                    <asp:LinkButton ID="FriendsLinkButton" runat="server" OnClick="ShowMoreFriends" OnClientClick="return HideFriendsDiv()"
                     SkinID="GridLinkButton" Text="<%$ Resources:Resource, BigMasterPage_AllNewsHyperlink  %>"></asp:LinkButton>
                    <asp:Label ID="TMPNumLabel" runat="server"></asp:Label>
                </ContentTemplate>
                </asp:UpdatePanel> 
                
                                                      
                
                <asp:UpdatePanel ID="UserIsTheConnectedUserPanel" runat="server" UpdateMode="Conditional">
                <ContentTemplate>
                   <br /><br />                    
                    <asp:Label ID="MutualFriendsTitleLabel" runat="server" SkinID="InfoLabel"
                    Text="<%$ Resources:Resource, UserPage_MutualFriendsTitleLabelText  %>"></asp:Label> 
                    <br />
                    
                    <asp:UpdateProgress ID="MutualFriendsUpdateProgress" runat="server" AssociatedUpdatePanelID="UserIsTheConnectedUserPanel">
                        <ProgressTemplate>
                            <div class="ajaxloader">
                                <asp:Image ID="MutualFriendsImage" runat="server" ImageUrl="~/Images/ajax-loader.gif" />
                            </div> 
                        </ProgressTemplate>
                    </asp:UpdateProgress>                    
                                       
                    <div id="MutualFriendsDiv">
                    <asp:ListView ID="MutualFriendsListView" runat="server" DataSourceID="MutualFriendsDataSourse" OnDataBound="MutualFrendsListViewDataBound">
                        <LayoutTemplate>
                            <asp:Label ID="itemplaceholder" runat="server"></asp:Label>
                        </LayoutTemplate>
                        <ItemTemplate>
                            <asp:HyperLink ID="UserNameHyperlink" runat="server" SkinID="GreenTitleHyperLink"
                                Text='<%# Eval("FriendName") %>' NavigateUrl='<%# "~/UserPage.aspx?Id=" + Eval("FriendId") %>'></asp:HyperLink>                        
                        </ItemTemplate>
                        <ItemSeparatorTemplate>
                            &nbsp;
                        </ItemSeparatorTemplate>
                        <EmptyDataTemplate>
                            <asp:Label ID="NoMutualFriendsLabel" runat="server" SkinID="GridLabel"
                            Text="<%$ Resources:Resource, UserPage_NoMutualFriendsLabelText  %>"></asp:Label>
                        </EmptyDataTemplate>
                    </asp:ListView>
                    </div>
                    <br />
                    <asp:LinkButton ID="MutualFriendsMoreLinkButton" runat="server" Text="<%$ Resources:Resource, BigMasterPage_AllNewsHyperlink  %>"
                     OnClick="MutualFriendsRefresh" OnClientClick="return MutualFriendsHide()" SkinID="GridLinkButton"></asp:LinkButton>
                </ContentTemplate>
                </asp:UpdatePanel> 
                                      
                    <asp:SqlDataSource ID="MutualFriendsDataSourse" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                    SelectCommand="Nivdal_FriendshipGetMutualFriendsTwoUsers" SelectCommandType="StoredProcedure"></asp:SqlDataSource>
                    <asp:SqlDataSource ID="FriendsListDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                    SelectCommand="Nivdal_GetListOfFriendsSimple" SelectCommandType="StoredProcedure"></asp:SqlDataSource>
                    <br /><br />
                    <asp:Panel ID="PrivateForumsPanel" runat="server">
                    <asp:Label ID="PrivateForumsTitleLabel" runat="server" Text="<%$ Resources:Resource, UserPage_PrivateForumsTitleLabel%>" SkinID="InfoLabel"></asp:Label>
                    <br />
                    <asp:GridView ID="PrivateForumsGridView" runat="server" AutoGenerateColumns="false" DataSourceID="UserForumsDataSourse" 
                     SkinID="Professional" AllowPaging="false" >
                     <Columns>
                        <asp:TemplateField>
                            <ItemTemplate>
                                
                                <asp:Image ID="ForumAdminImage" runat="server" ImageUrl="~/Images/Icons/usertypered.gif" ToolTip="<%$ Resources:Resource, UserPage_ForumAdminImageToolTip%>"
                                 Visible='<%# ForumIconName((decimal)(Eval("MembershipType"))) %>' />
                                 &nbsp;&nbsp;
                                <asp:HyperLink ID="ForumHyperlink" runat="server" SkinID="BlackHyperLinkSkin" 
                                 Text='<%# Eval("ForumName") %>' NavigateUrl='<%# "~/ForumDetails.aspx?Id=" + Eval("ForumId") %>'></asp:HyperLink>
                            </ItemTemplate>
                            <ItemStyle BorderWidth="0" />
                        </asp:TemplateField>
                       
                     </Columns>
                     
                     <EmptyDataTemplate>
                         <asp:Label ID="NoForumsLabel" runat="server" Text="<%$ Resources:Resource, UserPage_NoForumsLabel%>" 
                         SkinID="GridLabel"></asp:Label>
                     </EmptyDataTemplate>
                    </asp:GridView>     
                    <asp:SqlDataSource ID="UserForumsDataSourse" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                    SelectCommand="Nivdal_GetUserPrivateForums" SelectCommandType="StoredProcedure"></asp:SqlDataSource>
                </asp:Panel>
                </td>
                <td style="width:50%;vertical-align:top;">
                     <asp:UpdatePanel ID="GuestbookPanel" runat="server" UpdateMode="Conditional">
                <ContentTemplate>
                    <div style="background-image:url(Images/Wall_tab_over.jpg); background-repeat:no-repeat; 
                        background-position:center; text-align:center; vertical-align:top; padding-top:10px;
                        border-bottom-color:Silver; border-bottom-style:solid; border-bottom-width:2px;">
                        <asp:Label ID="GuestbookTitleLabel" runat="server" Text="<%$ Resources:Resource, Global_Guestbook %>"
                         SkinID="TeamNameLabel"></asp:Label>
                    </div>
                    <asp:Panel ID="WallMessagePanel" runat="server">
                        <asp:Label ID="WallMessageLabel" runat="server" SkinID="GreenSmallHeaderLabel"></asp:Label>
                        <br />
                    </asp:Panel>  
                    <asp:Panel ID="WriteOnWallPanel" runat="server">
                        <br />
                        <asp:Label ID="WriteSomethingOnThisWallTitleLabel" runat="server" SkinID="InfoLabel"
                        Text="<%$ Resources:Resource, TeamHomePage_WriteOnWallTitleLabelText %>"></asp:Label>
                        <br />
                        <%--<asp:TextBox ID="WriteOnWallTextBox" runat="server" TextMode="MultiLine" Width="90%" Height="100" MaxLength="256"></asp:TextBox>--%>
                        <CustomControls:TextArea ID="WriteOnWallTextBox"  runat="server" Width="90%" AutoPostBack="false" MaxLength="256" 
                         TextMode="MultiLine" Rows="3"></CustomControls:TextArea>
                         
                         <br /><br />
                        <asp:Button ID="LinkButton1" runat="server" Text="<%$ Resources:Resource, Global_Submit %>"
                          OnClick="SubmitToWallButtonClick" CssClass="GreenSmallButtonStyle"></asp:Button>
                          <%--&nbsp;&nbsp;&nbsp;
                        <asp:Button ID="Button2" onclick="Button2_Click" runat="server" Text="<%$ Resources:Resource, Global_Preview %>"  CssClass="GreySmallButtonStyle" />
                           <br />
                    <asp:Label ID="PreviewLabel" runat="server" CssClass="HtmlPreview" Text=""></asp:Label>--%>
                    </asp:Panel>
                    
                    <asp:UpdateProgress ID="WallUpdateProgress" runat="server" AssociatedUpdatePanelID="GuestbookPanel">
                        <ProgressTemplate>
                            <div class="ajaxloader">
                                <asp:Image ID="WallProgressImage" runat="server" ImageUrl="~/Images/ajax-loader.gif" />
                            </div>
                        </ProgressTemplate>
                    </asp:UpdateProgress>                    
                                         
                    <asp:DataPager ID="TopGuestBookPager" runat="server" PagedControlID="GuestBookListView" PageSize="10">
                        <Fields>
                            <asp:NumericPagerField ButtonCount="5" ButtonType="Link" CurrentPageLabelCssClass="PagerStyleCurrent"
                              NextPreviousButtonCssClass="PagerStyle" NumericButtonCssClass="PagerStyle"/>
                        </Fields>
                    </asp:DataPager> 
                    
                    <asp:ListView ID="GuestBookListView" runat="server" DataSourceID="GuestBookDataSource" 
                     OnItemCommand="DeleteWallEntry">
                        <LayoutTemplate>
                            <asp:Label ID="itemplaceholder" runat="server"></asp:Label>
                        </LayoutTemplate>
                        <ItemTemplate>
                            <table cellpadding="5" cellspacing="0">
                                <tr>
                                    <td style="width:35%;">
                                        <asp:Image ID="UserPictureImage" runat="server" ImageUrl='<%# Eval("Picture") %>'
                                         ToolTip='<%# Eval("UserName") %>' Width="64" onerror="this.src='Images/menupicture.gif';"/>
                                         <br />
                                         <asp:Label ID="DateLabel" runat="server" Text='<%# Eval("Date") %>' CssClass="NewsDateSmallStyle"></asp:Label>
                                        
                                    </td>
                                    <td style="vertical-align:top; width:55%;">   
                                        <asp:HyperLink ID="UserHyperlink" runat="server" Text='<%# Eval("UserName") %>'
                                         NavigateUrl='<%# "~/UserPage.aspx?Id=" + Eval("UserId") %>' SkinID="GreenTitleHyperLink"></asp:HyperLink>
                                        <div style="margin-top:8px; width:200px; height:100px; overflow:auto;">
                                        <asp:Label ID="EntryTextLabel" runat="server" 
                                        Text='<%# tryal(Eval("Text")) %>'                                           
                                         SkinID="GridLabel"></asp:Label>
                                        </div>
                                        
                                    </td>
                                    <td style="vertical-align:top; width:10%;">
                                        <asp:ImageButton ID="DeleteEntryImageButton" runat="server" ImageUrl="~/Images/Icons/delete.png"
                                         OnClientClick='<%# DeleteGuestbookOnClientClick() %>' CommandArgument='<%# Eval("EntryId") %>'
                                         CommandName="DeleteEntry" Visible='<%# Eval("CanDelete") %>' ToolTip="<%$ Resources:Resource, Global_Delete %>" />
                                    </td>
                                </tr>
                            </table>
                        </ItemTemplate>
                        <EmptyDataTemplate>
                            <asp:Label ID="EmptyGuestbookLabel" runat="server" SkinID="GridLabel"
                            Text="<%$ Resources:Resource, TeamHomePage_NothingOnWallLabelText  %>"></asp:Label>
                        </EmptyDataTemplate>
                    </asp:ListView>
                             
                    <asp:DataPager ID="GuestbookBottomDataPager" runat="server" PagedControlID="GuestBookListView" PageSize="10">
                        <Fields>
                            <asp:NumericPagerField ButtonCount="5" ButtonType="Link" CurrentPageLabelCssClass="PagerStyleCurrent"
                              NextPreviousButtonCssClass="PagerStyle" NumericButtonCssClass="PagerStyle" />
                        </Fields>
                    </asp:DataPager>  
                                        
                    <asp:SqlDataSource ID="GuestBookDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                    SelectCommand="Nivdal_WallGetWallEntries" SelectCommandType="StoredProcedure">
                    </asp:SqlDataSource>    
                </ContentTemplate>
                </asp:UpdatePanel>
                </td>
                </tr>
                </table>
                </div>
                </div>
                <div class="basic_element padding5">
                <asp:Panel ID="BehaviourReportsPanel" runat="server">
                <asp:Label ID="BehaviourReportsTitleLabel" runat="server" SkinID="InfoLabel" Text="<%$ Resources:Resource, UserPage_DisciplinaryReportsTitle %>"></asp:Label>
                <br />
                <asp:GridView ID="BehaviourReportsGridview" runat="server" SkinID="Professional" DataSourceID="BehaviourReportsDataSource" AutoGenerateColumns="false">
                    <EmptyDataTemplate>
                        <asp:Label ID="NoWarningsTitleLabel" runat="server" SkinID="GridLabel" Text="<%$ Resources:Resource, UserPage_NoReportsTitle %>"></asp:Label>                 
                    </EmptyDataTemplate>
                    <Columns>
                        <asp:TemplateField HeaderText="<%$ Resources:Resource, Global_Date %>">
                        <ItemTemplate>
                            <asp:Label ID="DateLabel" runat="server" Text='<%# Eval("Date") %>' SkinID="GridLabel"></asp:Label>
                        </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="<%$ Resources:Resource, Global_GameManager %>">
                        <ItemTemplate>
                            <asp:HyperLink ID="ManagerLink" runat="server" SkinID="GreenTitleHyperLink" Text='<%# Eval("GMPublicName") %>' NavigateUrl='<%# "~/UserPage.aspx?Id=" + Eval("GMUserId") %>'></asp:HyperLink>                
                        </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="<%$ Resources:Resource, Mail_ReportNoteTitle %>">
                        <ItemTemplate>
                            <asp:Label ID="Note" runat="server" Text='<%# Eval("Note") %>' SkinID="GridLabel"></asp:Label>
                        </ItemTemplate>
                        </asp:TemplateField>
                        <asp:CheckBoxField HeaderText="<%$ Resources:Resource, Global_IsActive %>" DataField="IsActive" />
                    </Columns>
                </asp:GridView>
                <asp:SqlDataSource ID="BehaviourReportsDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                    SelectCommand="Nivdal_GetUserBehaviourReports" SelectCommandType="StoredProcedure">
                </asp:SqlDataSource>         
                </asp:Panel>
                <div  style="margin:10px; border: solid 1px grey; padding: 10px 10px 10px 10px;" >
                <asp:UpdatePanel ID="AdminPanel" runat="server" UpdateMode="Conditional">
                <ContentTemplate>
                    <asp:Label ID="AdminDataLabel" runat="server" Text="<%$ Resources:Resource, UserPage_AdminDataLabel%>" SkinID="InfoLabel" ></asp:Label>
                    <br /><br />
                    <asp:FormView ID="UserAdminDataFormView" runat="server" DataSourceID="AdminDataSourse" DefaultMode="Edit" >
                        <EditItemTemplate>
                            <asp:DropDownList ID="UserLevelsDDL" runat="server"  CssClass="rounded_corners" SelectedValue='<%# Bind("UserAccessLevel") %>'>
                                <asp:ListItem Value="0">User without a team</asp:ListItem>
                                <asp:ListItem Value="1">Regular user</asp:ListItem>
                                <asp:ListItem Value="2">Forum Moderator</asp:ListItem>
                                <asp:ListItem Value="3">Translator</asp:ListItem>
                                <asp:ListItem Value="4">Game Master</asp:ListItem>
                                <asp:ListItem Value="5">Game Creator</asp:ListItem>
                            </asp:DropDownList>
                            <br /><br />
                            <asp:Label ID="TranslatesToLabel" runat="server" Text="<%$ Resources:Resource, UserPage_TranslatesToLabel%>" SkinID="InfoLabel"></asp:Label>
                            <asp:DropDownList ID="LanguageDDL" runat="server" DataSourceID="LanguagesDataSourse"  CssClass="rounded_corners"
                                DataValueField="LanguageId" DataTextField="LanguageName" SelectedValue='<%# Bind("TranslatesTo") %>'>
                            </asp:DropDownList>
                            <asp:SqlDataSource ID="LanguagesDataSourse" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                                SelectCommand="Nivdal_GetAllLanguages" SelectCommandType="StoredProcedure" >
                            </asp:SqlDataSource>
                            <br /><br />
                            <asp:Button ID="UpdateButton" runat="server" Text="<%$ Resources:Resource, Global_Update%>" CommandName="Update" CssClass="GreenSmallButtonStyle" />
                        </EditItemTemplate>            
                    </asp:FormView>
        
                    <asp:SqlDataSource ID="AdminDataSourse" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                    SelectCommand="Nivdal_GetUserAdminData" SelectCommandType="StoredProcedure"
                    UpdateCommand="Nivdal_UpdateUserAdminData" UpdateCommandType="StoredProcedure">
                        <SelectParameters>
                            <asp:ControlParameter ControlID="UserIdHiddenField" PropertyName="Value" Name="UserId" />
                            <asp:ControlParameter ControlID="LanguageHiddenField" PropertyName="Value" Name="Language" />
                        </SelectParameters>
                        <UpdateParameters>
                            <asp:ControlParameter ControlID="UserIdHiddenField" PropertyName="Value" Name="UserId" />
                            <asp:ControlParameter ControlID="LanguageHiddenField" PropertyName="Value" Name="Language" />
                            <asp:Parameter Name="TranslatesTo" Type="Decimal" />
                            <asp:Parameter Name="UserAccessLevel" Type="Decimal" />                
                        </UpdateParameters>
                    </asp:SqlDataSource>
                </ContentTemplate>
                </asp:UpdatePanel>  
                </div> 
                <br /><br />
                <asp:UpdatePanel ID="NewspaperUpdatePanel" UpdateMode="Conditional" runat="server">
                <ContentTemplate>
                    <asp:ListView ID="NewsPaperPrivsDataList" runat="server" DataSourceID="NewsPaperPrivsDataSourse">
                    <LayoutTemplate>
                        <asp:Label ID="itemplaceholder" runat="server"></asp:Label>
                    </LayoutTemplate>
                    <EditItemTemplate>
                        <div style="margin:10px; padding:10px; background-color:#C0C0C0;" >
                            <asp:HiddenField ID="NewsPaperIdHiddenField" runat="server" Value='<%# Bind("NewsPaperId") %>' />                
                            <asp:Label ID="Label1" runat="server" Text="<%$ Resources:Resource, Newspaper_EditNewspaperPrivsTitle %>" SkinID="InfoLabel"></asp:Label>
                            <br />
                            <asp:Label ID="NewsPaperNameTitleLabel" runat="server" Text='<%# Eval("NewsPaperName") %>' SkinID="SmallHeaderLabel"></asp:Label>
                            <asp:DropDownList ID="PrivsDDL" runat="server"  SelectedValue='<%# Bind("Privs") %>'  CssClass="rounded_corners">
                                <asp:ListItem Value="0" Text=""></asp:ListItem>
                                <asp:ListItem Value="1" Text="<%$ Resources:Resource, Newspaper_ReaderRole %>"></asp:ListItem>
                                <asp:ListItem Value="2" Text="<%$ Resources:Resource, Newspaper_WriterRole %>"></asp:ListItem>
                                <asp:ListItem Value="3" Text="<%$ Resources:Resource, Newspaper_EditorRole %>"></asp:ListItem>
                            </asp:DropDownList>
                            <asp:Button ID="UpdateButton" runat="server" Text="<%$ Resources:Resource, Global_Update %>" CssClass="GreenSmallButtonStyle" CommandName="update" />
                            &nbsp;
                            <asp:Button ID="CancelButton" runat="server" Text="<%$ Resources:Resource, Global_Cancel %>" CssClass="GreySmallButtonStyle" CommandName="cancel" />
                        </div>
                    </EditItemTemplate> 
                    <ItemTemplate>
                        <div style="margin:10px; padding:10px; background-color:#F0F0F0;" >
                            <asp:Label ID="Label1" runat="server" Text="<%$ Resources:Resource, Newspaper_EditNewspaperPrivsTitle %>" SkinID="InfoLabel"></asp:Label>
                            <br />
                            <asp:Label ID="NewsPaperNameTitleLabel" runat="server" Text='<%# Eval("NewsPaperName") %>' SkinID="GridLabel"></asp:Label>
                            <asp:DropDownList ID="PrivsDDL" runat="server" Enabled="false" SelectedValue='<%# Bind("Privs") %>'  CssClass="rounded_corners">
                                <asp:ListItem Value="0" Text=""></asp:ListItem>
                                <asp:ListItem Value="1" Text="<%$ Resources:Resource, Newspaper_ReaderRole %>"></asp:ListItem>
                                <asp:ListItem Value="2" Text="<%$ Resources:Resource, Newspaper_WriterRole %>"></asp:ListItem>
                                <asp:ListItem Value="3" Text="<%$ Resources:Resource, Newspaper_EditorRole %>"></asp:ListItem>
                            </asp:DropDownList>
                            <asp:Button ID="EditButton" runat="server" Text="<%$ Resources:Resource, Global_Edit %>" CssClass="GreenSmallButtonStyle" CommandName="edit" />
                        </div>
                    </ItemTemplate>
               
                    </asp:ListView> 
                    <br /><br />
                    <asp:Panel ID="QnAEditPanel" runat="server">
                    <asp:FormView ID="QnAEditorFormView" runat="server" DataSourceID="QnATipsSQLDataSource">
                    <EditItemTemplate>
                        <asp:CheckBox runat="server" ID="IsEditorCheckBox" Checked='<%# Bind("IsEditor") %>' Text="Is QnA Tips Editor" CssClass="NewsItemStyle" />
                        <br />
                        <asp:Button ID="UpdateButton" runat="server" Text="<%$ Resources:Resource, Global_Update %>" CssClass="GreenSmallButtonStyle"
                         CommandName="Update" />
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="IsEditor" runat="server" Text="This user is QnA tips editor" Visible='<%# Eval("IsEditor") %>' SkinID="GridLabel"></asp:Label>
                        <asp:Label ID="IsNotEditor" runat="server" Text="this user is not QnA Tips editor"
                         Visible='<%# !(bool)Eval("IsEditor") %>' SkinID="GridLabel"></asp:Label>
                         <br />
                        <asp:Button ID="EditButton" runat="server" Text="Edit" CommandName="Edit" CssClass="GreenSmallButtonStyle" />
                    </ItemTemplate>
                    </asp:FormView>
                    </asp:Panel>
                    </ContentTemplate>
                    </asp:UpdatePanel>
                </div>
                

                
            
               
    

    
    
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        SelectCommand="Nivdal_GetUserDetails" SelectCommandType="StoredProcedure">
        <SelectParameters>
            <asp:ControlParameter ControlID="LanguageHiddenField" Name="Language" PropertyName="Value" Type="Decimal" />
        </SelectParameters>    
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="NewsPaperPrivsDataSourse" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        SelectCommand="Nivdal_GetUserNewspaperPriviliagesForUserPage" SelectCommandType="StoredProcedure"
        UpdateCommand="Nivdal_UpdateNewspaperPrivs" UpdateCommandType="StoredProcedure">
        <UpdateParameters>
            <asp:ControlParameter ControlID="UserIdHiddenField" PropertyName="Value" Name="UserId" Type="String" />
        </UpdateParameters>  
                 
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="QnATipsSQLDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        SelectCommand="Nivdal_GetUserQnATipsStatus" SelectCommandType="StoredProcedure"
        UpdateCommand="Nivdal_SetUserQnATipsStatus" UpdateCommandType="StoredProcedure">
        <UpdateParameters>
            <asp:ControlParameter ControlID="UserIdHiddenField" PropertyName="Value" Name="UserId" Type="String" />
        </UpdateParameters> 
    </asp:SqlDataSource>
</asp:Content>

